body {
	font-family: Arial, sans-serif;
	margin: 0;
	padding: 0;
	/* background-image: url("../img/preview.jpg"); */
	background-size: cover;
	background-attachment: fixed;
	background-position: center;
	color: #333;
	line-height: 1.6;
}

header {
	background: rgba(0, 0, 0, 0.8);
	color: white;
	padding: 1em;
	text-align: center;
	position: sticky;
	top: 0;
	z-index: 1000;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

header h1 {
	margin: 0;
	font-size: 2.5em;
}

nav ul {
	list-style-type: none;
	padding: 0;
	display: flex;
	justify-content: center;
	margin: 1em 0;
}

nav ul li {
	margin: 0 1em;
}

nav ul li a {
	color: white;
	text-decoration: none;
	font-weight: bold;
	padding: 0.5em 1em;
	border-radius: 5px;
	transition: background 0.3s, transform 0.3s;
}

nav ul li a:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: scale(1.1);
}

#game-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center; /* 垂直居中 */
	height: calc(80vh - 60px); /* 减去header的高度 */
	padding-top: 30px; /* 减少上边距 */
}

#game-area {
	display: grid;
	grid-template-columns: repeat(45, 20px); /* 增大地图 */
	grid-template-rows: repeat(30, 20px); /* 增大地图 */
	gap: 1px;
   background-color: #87CEFA; /* 天蓝色背景 */
	border: 2px solid #ffffff;
	margin: auto; /* 居中对齐 */
}

.grid-cell {
	width: 20px;
	height: 20px;
   background-color: #ADD8E6; /* 更浅的天蓝色 */
}

.snake {
	background-color: #007ACC;
}

.snake-head {
	background-color: #FFD700; /* 黄色，作为头部区别显示 */
}

.food {
	background-color: #FF4500; /* 鲜红色，突出与背景 */
}

#controls {
	margin-top: 10px;
	margin-bottom: 20px;
}

button {
	padding: 10px 20px;
	font-size: 16px;
	cursor: pointer;
	background-color: #007ACC; /* 深蓝色按钮 */
	color: white;
	border: none;
	border-radius: 5px;
	transition: background 0.3s, transform 0.3s;
}

button:hover {
	background-color: #005f99;
	transform: scale(1.05);
}

/* 新增的样式，用于二级菜单 */
.dropdown-content {
	display: none;
	position: absolute;
	background-color: #f9f9f9;
	box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
	z-index: 1;
}

.dropdown-content a {
	color: black;
	padding: 12px 16px;
	text-decoration: none;
	display: block;
}

.dropdown-content a:hover {
	background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
	display: block;
}

.video-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: -1; /* 将视频放在所有内容的后面 */
}

video {
	width: 100%;
	height: 100%;
	object-fit: cover; /* 确保视频填满容器，保持宽高比例 */
	position: absolute;
	top: 0;
	left: 0;
}

/* 自定义弹窗样式 */
.custom-alert {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: white;
	padding: 20px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	z-index: 10000;
	border-radius: 10px;
	text-align: center;
}

.custom-alert p {
	margin: 0;
	padding: 0;
	margin-bottom: 10px;
	font-size: 16px;
}

.custom-alert button {
	padding: 5px 10px;
	background-color: #007ACC;
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	transition: background 0.3s;
}

.custom-alert button:disabled {
	background-color: #cccccc;
	cursor: not-allowed;
}

.custom-alert button:hover:enabled {
	background-color: #005f99;
}